package com.sixuerain.heartkey.prayer.db;

import android.content.Context;
import com.sixuerain.heartkey.app.base.JLog;

public class DaoFactory extends DBConnect {
	private static final String TAG = "DaoFactory";
	
	public DaoFactory(Context context) {
		super(context);
	}

	public <T> T getDAO(Class<T> objectDao) {

		T dao = null;
		try {
			dao = objectDao.newInstance();
		} catch (InstantiationException e) {
			JLog.e(TAG, "Fail to instance.", e);
		} catch (IllegalAccessException e) {
			JLog.e(TAG, "Illegal Access.", e);
		}
		return dao;
	}
}
